/**
 * 函数节流
 * @param fn
 * @param interval
 * @returns {Function}
 * @constructor
 */


//j节流时间戳
export function throttle(func, wait) {
  let previous = 0;
  return function() {
      let now = Date.now();
      let context = this;
      let args = arguments;
      if (now - previous > wait) {
          func.apply(context, args);
          previous = now;
      }
  }
}

